<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

use App\Services\Common;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
    
    /** @var Common */
    public $common;
 
    /**
     * EmailService constructor.
     * @param Mailer $mail
     */
    public function __construct(Common $common)
    {
        $this->common = $common;
    }

    
    // 返回json信息
	public function returnMsg($code, $msg, $data=false){
    	
    	$return['code'] = $code;
    	$return['msg'] = $msg;
    	if ($data !== false){
    		$return['data'] = $data;
    	}
    	
    	return json_encode($return, true);
    }
}
